import request from '@/utils/request'
const URL_PREFIX = '/iam/user'

export default {
  fetchList(queryParams) {
    return request({
      url: `${URL_PREFIX}/list?page=${queryParams.pageNum}&pageSize=${queryParams.pageSize}`,
      method: 'post',
      data: queryParams
    })
  },
  getInfo(id) {
    return request({
      url: `${URL_PREFIX}/info/${id}`,
      method: 'post'
    })
  },
  grantRoles(id, data) {
    return request({
      url: `${URL_PREFIX}/grant-role/${id}`,
      method: 'post',
      data: data
    })
  }
}
